package com.sdry.service.impl.lz;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.sdry.mapper.lz.DeviceAlarmMapper;
import com.sdry.model.lz.CheckItem;
import com.sdry.model.lz.CheckItemDetail;
import com.sdry.model.lz.DeviceCheckItem;
import com.sdry.model.lz.LzQueryCriteria;
import com.sdry.service.lz.DeviceAlarmService;

/**
 * @ClassName DeviceAlarmServiceImpl
 * @Description 设备报警
 * @Author lz
 * @Date 2018年9月25日 15:55:33
 * @Version 1.0
 */
@Service
@Transactional
public class DeviceAlarmServiceImpl implements DeviceAlarmService {

    @Resource
    DeviceAlarmMapper deviceAlarmMapper;
    /**
     * 添加设备巡检记录
     * @param deviceCheckItem 巡检实体
     * @return
     */
    @Override
    public Long addCheckRecord(DeviceCheckItem deviceCheckItem) {
        return deviceAlarmMapper.addCheckRecord(deviceCheckItem);
    }

    /**
     * 根据选中行的ID删除该行数据
     * @param id
     * @return
     */
    @Override
    public Long deleteCheckRecordById(long id) {
        return deviceAlarmMapper.deleteCheckRecordById(id);
    }

    /**
     * 根据ID修改巡检项信息
     * @param deviceCheckItem 选中行的巡检项
     * @throws Exception
     */
    @Override
    public Long editCheckRecordById(DeviceCheckItem deviceCheckItem) {
        return deviceAlarmMapper.editCheckRecordById(deviceCheckItem);
    }

    /**
     * 查询巡检记录表
     * @param criteria
     * @return
     */
    @Override
    public List<DeviceCheckItem> queryCheckRecord(LzQueryCriteria criteria) {
        return deviceAlarmMapper.queryCheckRecord(criteria);
    }

    /**
     * 查询巡检记录表条数
     * @param criteria
     * @return
     */
    @Override
    public int countCheckRecord(LzQueryCriteria criteria) {
        return deviceAlarmMapper.countCheckRecord(criteria);
    }


    /**
     * 查询点检项
     * @param criteria
     * @return
     */
    @Override
    public List<CheckItem> queryCheckItem(LzQueryCriteria criteria) {
        return deviceAlarmMapper.queryCheckItem(criteria);
    }

    /**
     * 查询点检项条数
     * @param criteria
     * @return
     */
    @Override
    public int countCheckItem(LzQueryCriteria criteria) {
        return deviceAlarmMapper.countCheckItem(criteria);
    }

    /**
     * 单个删除和批量删除
     * @param id
     * @return
     */
    @Override
    public Long deleteCheckItemById(long id) {
        return deviceAlarmMapper.deleteCheckItemById(id);
    }

    /**
     * 根据ID修改编辑
     * @param checkItem
     * @return
     */
    @Override
    public Long editCheckItemById(CheckItem checkItem) {
        return deviceAlarmMapper.editCheckItemById(checkItem);
    }

    /**
     * 增加设备巡检项
     * @param checkItem
     * @return
     */
    @Override
    public Long addCheckItem(CheckItem checkItem) {
        return deviceAlarmMapper.addCheckItem(checkItem);
    }

    /**
     * 增加设备巡检项详细
     * @param checkItemDetail
     * @return
     */
    @Override
    public Long addCheckItemDetail(CheckItemDetail checkItemDetail) {
        return deviceAlarmMapper.addCheckItemDetail(checkItemDetail);
    }

    /**
     * 根据ID查询巡检项详细
     * @param cdId 选中行的巡检项
     * @return
     */
    @Override
    public List<CheckItemDetail> queryCheckItemDetailById(long cdId) {
        return deviceAlarmMapper.queryCheckItemDetailById(cdId);
    }

    /**
     * 根据选中行的ID删除该行数据
     * @param id
     * @return
     */
    @Override
    public Long deleteCheckItemDetailById(long id) {
        return deviceAlarmMapper.deleteCheckItemDetailById(id);
    }

    /**
     * 根据选中行的ID编辑该行数据
     * @param checkItemDetail
     * @return
     */
    @Override
    public Long editCheckItemDetailById(CheckItemDetail checkItemDetail) {
        return deviceAlarmMapper.editCheckItemDetailById(checkItemDetail);
    }

    /**
     * 根据该行id查询数组remark02
     * @param id
     * @return
     */
    @Override
    public DeviceCheckItem queryArrayListById(long id) {
        return deviceAlarmMapper.queryArrayListById(id);
    }

    /**
     * 根据查出的id遍历选项
     * @param id
     * @return
     */
    @Override
    public CheckItem queryCheckItemById(long id) {
        return deviceAlarmMapper.queryCheckItemById(id);
    }

    @Override
    public CheckItemDetail queryCheckItemDetailListByList(Integer id) {
        return deviceAlarmMapper.queryCheckItemDetailListByList(id);
    }

}
